package com.example.demo.tools;

import org.springframework.security.crypto.bcrypt.BCrypt;

/**
 * 简单的命令行工具，用于生成 BCrypt 密码摘要。
 */
public class PasswordHasher {

    public static void main(String[] args) {
        if (args.length == 0) {
            System.err.println("Usage: PasswordHasher <rawPassword>");
            System.exit(1);
        }
        String raw = args[0];
        String hashed = BCrypt.hashpw(raw, BCrypt.gensalt());
        System.out.println(hashed);
    }
}


